#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/report.class.php';
su('admin');

/**

title=测试 reportModel->convertFormat();
cid=1
pid=1

测试获取 2022-01-01 到 2022-01-05 的日期列表 >> 2022-01-03,2022-01-04,2022-01-05
测试获取 2022-01-06 到 2022-01-10 的日期列表 >> 2022-01-06,2022-01-07,2022-01-10
测试获取 2022-01-11 到 2022-01-15 的日期列表 >> 2022-01-11,2022-01-12,2022-01-13,2022-01-14
测试获取 2022-01-16 到 2022-01-20 的日期列表 >> 2022-01-17,2022-01-18,2022-01-19,2022-01-20
测试获取 2022-01-01 到 2022-01-05 的日期列表 >> 2022-01-01,2022-01-02,2022-01-03,2022-01-04,2022-01-05
测试获取 2022-01-06 到 2022-01-10 的日期列表 >> 2022-01-06,2022-01-07,2022-01-08,2022-01-09,2022-01-10
测试获取 2022-01-11 到 2022-01-15 的日期列表 >> 2022-01-11,2022-01-12,2022-01-13,2022-01-14,2022-01-15
测试获取 2022-01-16 到 2022-01-20 的日期列表 >> 2022-01-16,2022-01-17,2022-01-18,2022-01-19,2022-01-20

*/
$report = new reportTest();

global $tester;
$execution = $tester->loadModel('execution');

$date1 = $execution->getDateList('2022-01-01', '2022-01-05', 'noweekend');
$date2 = $execution->getDateList('2022-01-06', '2022-01-10', 'noweekend');
$date3 = $execution->getDateList('2022-01-11', '2022-01-15', 'noweekend');
$date4 = $execution->getDateList('2022-01-16', '2022-01-20', 'noweekend');
$date5 = $execution->getDateList('2022-01-01', '2022-01-05', 'withweekend');
$date6 = $execution->getDateList('2022-01-06', '2022-01-10', 'withweekend');
$date7 = $execution->getDateList('2022-01-11', '2022-01-15', 'withweekend');
$date8 = $execution->getDateList('2022-01-16', '2022-01-20', 'withweekend');

r($report->convertFormatTest($date1[0])) && p() && e('2022-01-03,2022-01-04,2022-01-05');                       // 测试获取 2022-01-01 到 2022-01-05 的日期列表
r($report->convertFormatTest($date2[0])) && p() && e('2022-01-06,2022-01-07,2022-01-10');                       // 测试获取 2022-01-06 到 2022-01-10 的日期列表
r($report->convertFormatTest($date3[0])) && p() && e('2022-01-11,2022-01-12,2022-01-13,2022-01-14');            // 测试获取 2022-01-11 到 2022-01-15 的日期列表
r($report->convertFormatTest($date4[0])) && p() && e('2022-01-17,2022-01-18,2022-01-19,2022-01-20');            // 测试获取 2022-01-16 到 2022-01-20 的日期列表
r($report->convertFormatTest($date5[0])) && p() && e('2022-01-01,2022-01-02,2022-01-03,2022-01-04,2022-01-05'); // 测试获取 2022-01-01 到 2022-01-05 的日期列表
r($report->convertFormatTest($date6[0])) && p() && e('2022-01-06,2022-01-07,2022-01-08,2022-01-09,2022-01-10'); // 测试获取 2022-01-06 到 2022-01-10 的日期列表
r($report->convertFormatTest($date7[0])) && p() && e('2022-01-11,2022-01-12,2022-01-13,2022-01-14,2022-01-15'); // 测试获取 2022-01-11 到 2022-01-15 的日期列表
r($report->convertFormatTest($date8[0])) && p() && e('2022-01-16,2022-01-17,2022-01-18,2022-01-19,2022-01-20'); // 测试获取 2022-01-16 到 2022-01-20 的日期列表